<script>
	import {checkUpdateVersion} from 'util/common/index.js';
	import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
	export default {
		globalData: {  
		            navBarIndex: ''  
		        },
		onLaunch: function(options) {
			uni.hideTabBar()
			// if(options.scene==1007 ||options.scene==1008){//从会话分享页进入，先不授权
			// 	return
			// }
			// let userToken=uni.getStorageSync('userToken');
			// if(!userToken){
			// 	uni.navigateTo({
			// 					url:"/pages/login/index"
			// 				  })
			// }
			// uni.checkSession({
			// 	fail(){
			// 	  uni.navigateTo({
			// 				url:"/pages/login/index"
			// 			  })
			// 		}
			// })
			// checkUpdateVersion()
			this.getUserInfo()
			console.log('App Launch')
		},
		onShow: function() {
			uni.hideTabBar()
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods:{
			...mapActions('userInfo', [
			      'setUserInfoAsync' // 将 `this.increment()` 映射为 `this.$store.dispatch('increment')`
			    ]),
			async getUserInfo(){
				let userToken=uni.getStorageSync('userToken');
				if(userToken){
					let res=await this.$api.getUserInfo({
						user_token:userToken
					})
					if(res.data.level=='success'){
						this.setUserInfoAsync(res.data.data)
						uni.setStorageSync('user_id',res.data.data.user_id)
					}
				}
				
			}
		}
	}
</script>

<style lang="scss">
	@import url("./static/quill.core.css");
	@import url("./static/quill.snow.css");
	@import url("./static/quill.bubble.css");
	@import url("/components/gaoyia-parse/parse.css");
	.null{
		width: calc(100vw - 60rpx);
		padding: 30rpx;
		text-align: center;
	}
	page{
		width: 100vw;
		min-height: 100vh;
	};
	uni-page-head .uni-page-head{
		display: none;
	}
	uni-tabbar, uni-tabbar .uni-tabbar{
		display: none;
	}
	uni-page-head .uni-page-head~.uni-placeholder{
		display: none;
	}
</style>
